#pragma once

#include <iostream>
#include <google/protobuf/service.h>
#include <google/protobuf/descriptor.h>

class EZRPC_ServerPool
{
public:
	bool register_server(google::protobuf::Service* sr);

	void unregister_server(google::protobuf::Service* sr);

	google::protobuf::Service* server_desc(const std::string& server_name);

	const google::protobuf::MethodDescriptor* method_desc(const std::string& server_name
		, const std::string& method_name);
private:
	struct server_info
	{
		std::string server_name;
		google::protobuf::Service* server;
		struct method_info
		{
			std::string method_name;
			const google::protobuf::MethodDescriptor* method_desc;
		};
		std::vector<method_info> method_list;
	};

	std::vector<server_info> reg_list;
};

